package com.school.manager.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.school.manager.domaim.SysClass;
import com.school.manager.entity.po.SysClassPo;
import com.school.manager.entity.vo.SysClassVo;
import com.school.manager.mapper.SysClassMapper;
import com.school.manager.service.ISysClassService;
import com.school.manager.utils.PageUtil;

import lombok.extern.slf4j.Slf4j;

/**
 * description：班级业务实现类
 * date：2021/10/133:18 下午
 */

@Service
@Slf4j
public class SysClassServiceImpl extends ServiceImpl<SysClassMapper, SysClass> implements ISysClassService {
	
	@Autowired
    private SysClassMapper tecClassMapper;
	
	@Override
	public Page<SysClassVo> page(SysClassPo tecClassPo) {
		QueryWrapper<SysClass> queryWrapper = PageUtil.buildQueryWrapper(tecClassPo, SysClass.class);
        Page<SysClass> page = new Page<>(tecClassPo.getCurrent(), tecClassPo.getSize());
        tecClassMapper.selectPage(page, queryWrapper);
        return PageUtil.buildPage(page, SysClassVo.class);
	}
	

}
